<template>
	<view class="content bgc-f0">
		<view class="p26 bgc-fff search_sticky">
			<u-search 
				placeholder="请输入客户姓名,手机号等关键字" 
				v-model="value" shape="round" 
				@blur="getStreamData" 
				@search="getStreamData" 
				@custom="getStreamData"
			>
			</u-search>
		</view>
		
		<template v-if="list.length > 0">
			<template v-for="(it,index) in list">
				<view class="_li" :key="index">
					<u-image :src="it.productCover" width="110" height="110" border-radius="6"></u-image>
					<view class="flex-1 fs26 z-flex ml20" style="flex-direction: column;position: relative;">
						<view class="z-flex z-flex-align-c">
							<text class="fs30">{{it.productName}}</text>
							<text v-if="it.writeOffUserName" class="fs24 c-999">（核销人：{{it.writeOffUserName}}）</text>
						</view>
						<view class="z-flex z-flex-align-c mt20 mb10">
							<text class="mr40 c-666">核销时间：{{it.writeOffTime.slice(0,19)}}</text>
							<!-- <text>购买</text> -->
						</view>
						<!-- <view><text>补差价</text></view>
						<view class="_line mt10"></view>
						<view class="z-flex z-flex-between pt20">
							<text>消费金额：￥2500</text>
							<text>消费金额：￥2500</text>
						</view> -->
						<!-- <view class="_total"><text class="fs30 c-fff">87.08</text></view> -->
					</view>
				</view>
			</template>
		</template>
		
		<vempty v-show="dataLe" title="暂无数据"></vempty>
	</view>
</template>

<script>
	import { getOrderWriteOffApi } from '@/api/order.js'
	export default{
		data(){
			return {
				value: '',
				dataLe: false,
				list: [],
				query: {
					page: 1,
					size: 10
				}
			}
		},
		onShow() {
			this.$nextTick(this.getStreamData)
		},
		methods:{
			async getStreamData(){
				uni.showLoading({
					title: '数据加载中...'
				})
				const {code,data} = await getOrderWriteOffApi({
					businessId: uni.getStorageSync('businessId')
				})
				uni.hideLoading()
				if(code != 0) return
				this.list = data.list
				this.dataLe = data.count == 0
			}
		}
	}
</script>

<style scoped lang="scss">
	.content{
		._li{
			display: flex;
			padding: 26rpx;
			border-bottom: 1rpx solid #F8F8F8;
			background-color: #FFFFFF;
			._total{
				width: 120rpx;
				height: 50rpx;
				line-height: 50rpx;
				text-align: center;
				background-color: $uni-color-theme;
				border-radius: 40rpx;
				position: absolute;
				right: 0;
				top: 50%;
				transform: translateY(-54rpx);
			}
			._line{
				border-bottom: 1rpx solid #F8F8F8;
			}
		}
	}
</style>
